package io.mft.as.adapter.exception;

/**
 * 业务异常类。
 * errorCode用于显示返回信息，errMsg仅用于打印日志
 * 建议errorCode不要与funNo关联
 * @author 肖明
 */
public class BusinessException extends RuntimeException {
	
	private static final long serialVersionUID = 1L;
	
	private int errorCode;//拦截器中根据返回码找到对应的信息显示
	private String[] params = null;//提示信息中的参数。参数配置的形式为：${0}、${1}
	public int getErrorCode() {
		return errorCode;
	}
	public String[] getParams() {
		return params;
	}
	
	public BusinessException(int errorCode){
		super();
		this.errorCode = errorCode;
	}
	public BusinessException(int errorCode, String errMsg){
		super(errMsg);
		this.errorCode = errorCode;
	}
	public BusinessException(int errorCode, Throwable t){
		super(t);
		this.errorCode = errorCode;
	}
	public BusinessException(int errorCode, String errMsg, Throwable t){
		super(errMsg, t);
		this.errorCode = errorCode;
	}
	public BusinessException(int errorCode, String[] params){
		super();
		this.errorCode = errorCode;
		this.params = params;
	}
	public BusinessException(int errorCode, String errMsg, String[] params){
		super(errMsg);
		this.errorCode = errorCode;
		this.params = params;
	}
	public BusinessException(int errorCode, Throwable t, String[] params){
		super(t);
		this.errorCode = errorCode;
		this.params = params;
	}
	public BusinessException(int errorCode, String errMsg, Throwable t, String[] params){
		super(errMsg, t);
		this.errorCode = errorCode;
		this.params = params;
	}
}
